<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="../../common.jsp"%>

<%@page import="system.base.ProductTypeManager"%>
<%@page import="framework.core.Conditions"%>
<%@page import="framework.core.DBConnection"%>
<%@page import="framework.core.ObjectList"%>
<html>
<head>
<title>产品修改</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
    String manufactureid = (String)request.getAttribute("manufactureid");
    ArrayList tManuf1 = (ArrayList)request.getAttribute("manufacture1");
    HashMap tMap1 = (HashMap)request.getAttribute("manufacturetyp2");
    HashMap tMap2 = (HashMap)request.getAttribute("manufacturetyp3");
    GSManufactureBean manubean=(GSManufactureBean)request.getAttribute("manubean");
    GSManufactureCategoryBean catbean=(GSManufactureCategoryBean)request.getAttribute("catBean");
    String providerName=(String)request.getAttribute("providerName");
    HashMap map=(HashMap)request.getAttribute("prope");
    ArrayList tList1 = new ArrayList();
    String isPlanPrice = (String)request.getAttribute("isPlanprice");
    String count = (String)request.getAttribute("count");
   
%>
<script language="JavaScript"><!--
var request = false;
function selectyes(a,b){
    var old  = document.getElementById("concentricity_code_back").value;
    a.value=Trim(a.value);
    if(a.value == old) return;
    if(Trim(a.value)==""){
        return false;
    }
    if(window.XMLHttpRequest) {  //非IE浏览器，用xmlhttprequest对象创建
        request=new XMLHttpRequest();
    } else if(window.ActiveXObject) { //IE浏览器用activexobject对象创建
        request=new ActiveXObject("Microsoft.XMLHttp");
    }
    
    if(request){
        var sid= Trim(a.value);
        var url = "<%=response.encodeURL(root+"/jsp/sysmaintain/manufactureAddCon.jsp")%>?conid=" + sid+"&ck="+b; 
        url=encodeURI(url);
        request.open("GET", encodeURI(url), true); 
        if(b=="1"){
            request.onreadystatechange = updatePage; 
        }
        request.send(null);
    }else{
        document.getElementById("conidyes").innerText="*";
    }
}

function updatePage(){
var f=document.getElementById("conidyes");
var sign=document.getElementById("sign");
    if(request.readyState == 4){      //已完成
        if(request.status == 200){ 
            var text = request.responseText;
            if(text!=null&&Trim(text)!=""){
                sign.value="1";
                var row=Trim(text).split("-");
                f.innerHTML="有 "+row[0]+" 条相同集中编码产品";
                //if(row.length>1){
                //    p.value=row[1];
                //}
            }else{
                f.innerText="*";
                sign.value="0";
            }
        }else 
            f.innerText="*";
            sign.value="0";
        }
}
    var counter;
    function change1(optval){
  var val = optval;
  if(val=='0'){
    var listbox = document.getElementById("manuftype2");
    listbox.length = 0;
    var option = new Option();
    option.text = "-----二级-----";
    option.value = "0";
    listbox.options[listbox.length] = option;
    change2(optval);
  }else{
      var counter="0";
    <%if(tMap1 !=null){
      Collection tCollection = tMap1.keySet();
      Iterator tIterator = tCollection.iterator();
      while(tIterator.hasNext()){
        String tKey = (String)tIterator.next();
        tList1 = (ArrayList)tMap1.get(tKey);%>
        if(val == '<%=tKey%>'){
          counter = "1";
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "-----二级-----";
          listbox.options[listbox.length] = option;
          <%
                for(int n=0;n<tList1.size();n++){
                    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList1.get(n);
                    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                    var temp1 = '<%=categoryId%>';
                    var temp2 = '<%=categoryName%>';
                    var option = new Option();
                    option.value = temp1;
                    option.text = temp2;
                    listbox.options[listbox.length] = option;
           <%
                }
           %>
            change2('0');           
         }
         
    <%
        }
    %>
        if(counter == '0'){
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "-----二级-----";
          listbox.options[listbox.length] = option;  
          change2('0');     
        }
    <%  
    }
    %>
   }
}
    function change2(optval){
      var val = optval;
      if(val=='0'){
        var listbox = document.getElementById("manuftype3");
        listbox.length = 0;
        var option = new Option();
        option.text = "-----三级-----";
        option.value = "0";
        listbox.options[listbox.length] = option;

      }else{
        var counter = "0";
        <%if(tMap2 !=null){
          Collection tCollection = tMap2.keySet();
          Iterator tIterator = tCollection.iterator();
          while(tIterator.hasNext()){
            String tKey = (String)tIterator.next();
            tList1 = (ArrayList)tMap2.get(tKey);%>
            if(val == '<%=tKey%>'){
              counter = "1";
              var listbox = document.getElementById("manuftype3");
              listbox.length = 0;
              var option = new Option();
              option.text = "-----三级-----";
              option.value = "0";
              listbox.options[listbox.length] = option;
              <%for(int n=0;n<tList1.size();n++){
                GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList1.get(n);
                String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                var temp1 = '<%=categoryId%>';
                var temp2 = '<%=categoryName%>';
                var option = new Option();
                option.value = temp1;
                option.text = temp2;
                listbox.options[listbox.length] = option;
                <%}%>
              }
          <%
          }
          %>
          if(counter == '0'){
                var listbox = document.getElementById("manuftype3");
                listbox.length = 0;
                var option = new Option();
                option.text = "-----三级-----";
                option.value = "0";
                listbox.options[listbox.length] = option;          
          }
          <%
            }%>
          }
        }
        var v="0.0";
        function getoldprice(obj){
            v=obj.value;
        }
        function pricef(obj){
            if(parseFloat(obj.value)<=0||isNaN(obj.value)){
                obj.value=v;
            }
        }
        function checkValue(){
        	var patm = /^[^'"<>&]*$/;
        	if(!patm.test(document.all.concentricity_code.value)||
        	   !patm.test(document.all.manufacturename.value)||
        	   !patm.test(document.all.quantunit.value)||
        	   !patm.test(document.all.manufacturetype.value)||
        	   !patm.test(document.all.manfuacturespec.value)||
        	   !patm.test(document.all.qualityassureperiod.value)||
        	   !patm.test(document.all.manufacturername.value)||
        	   !patm.test(document.all.makearea.value)||
        	   !patm.test(document.all.manufacturebrand.value)){
        		alert("输入信息不允许有',\",<,>,&等特殊字符");
        		return false;
        	}
        	
        	var perad = /^\d+$/;
        	if(!perad.test(document.all.qualityassureperiod.value)&&document.all.qualityassureperiod.value!=""){
        		alert("质保期请输入0或者正整数，默认单位为天!");
        		return false;
        	}
        	if(!perad.test(document.all.kmqualityassureperiod.value)&&document.all.kmqualityassureperiod.value!=""){
        		alert("质保期请输入0或者正整数，默认单位为天!");
        		return false;
        	}
            if(document.all.concentricity_code_back.value == null || Trim(document.all.concentricity_code_back.value) == ""){
                alert("请输入产品集中编码");
                return false;
            }
            if(document.all.manufacturename.value == null || Trim(document.all.manufacturename.value) == ""){
                alert("请输入产品名称");
                return false;
            }
            if(document.all.manuftype1.options[0].selected && document.all.manuftype2.options[0].selected && document.all.manuftype3.options[0].selected){
                alert("请输入产品种类");
                return false;
            }
            if(document.all.quantunit.value == null || Trim(document.all.quantunit.value) == ""){
                alert("请输入产品数量单位");
                return false;
            }
            if(document.all.unitprice.value == null || Trim(document.all.unitprice.value) == ""||parseFloat(document.all.unitprice.value)<=0||isNaN(document.all.unitprice.value)){
                alert("请输入产品单价");
                return false;
            }
            if(document.all.providerid.value == null || document.all.providerid.value == ""){
                alert("请选择供应商");
                return false;
            }
            if(document.all.remark.value.length>2000){
                alert("备注长度不能超过2000字符");
                return false;
            }

            
            return true;
        }
        
                /** 判断集中编码是否被改变*/
        function isConcentricityChanged(){
            var newCode = document.getElementById("concentricity_code").value;
            var oldCode = document.getElementById("concentricity_code_back").value;
            if(oldCode!=newCode) return true;
            return false;
        }
        
        function process(){
            getprovalue();
            if(isConcentricityChanged()){
                if(!confirm("集中编码已被修改,确认提交?")){ 
                    return false;
                }                                       
            }
            if(checkValue()){
            var isPlanPrice = <%=isPlanPrice%>;
            if(isPlanPrice==1){
                    var ary=new Array(26);
                    ary[0]=form1.manuftype1.value;
                    ary[1]=form1.manuftype2.value;
                    ary[2]=form1.manuftype3.value;
                    ary[3]=form1.manufacturecode.value;
                    ary[4]=document.getElementById("concentricity_code").value;
                    ary[5]=form1.manufacturename.value;
                    ary[6]=form1.providerid.value;
                    ary[7]=form1.unitprice.value;
                    ary[8]=form1.quantunit.value;
                    ary[9]=form1.manufacturetype.value;
                    ary[10]=form1.manfuacturespec.value;
                    ary[11]=form1.qualityassureperiod.value;
                    ary[12]=form1.manufacturername.value;
                    ary[13]=form1.makearea.value;
                    ary[14]=form1.manufacturebrand.value;
                    ary[15]=form1.drawingpiececode.value;
                    ary[16]=form1.isbuy.value;
                    ary[17]=form1.machinetype.value;
                    ary[18]=form1.property.value;
                    ary[19]=form1.remark.value;
                    ary[20]=form1.balancemode.value;
                    ary[21]=document.getElementById("concentricity_code_back").value;
                    ary[22]=form1.planprice.value;
                    ary[23]=form1.productType.value;
                    ary[24]=form1.productBid.value;
                    ary[25]=form1.kmqualityassureperiod.value;
                    ary[26]=form1.balancecustomercode.value;
                    ary[27]=form1.pic.value;
                    window.returnValue = ary;     
                    window.close();
                }else{
                    var ary=new Array(25);
                    ary[0]=form1.manuftype1.value;
                    ary[1]=form1.manuftype2.value;
                    ary[2]=form1.manuftype3.value;
                    ary[3]=form1.manufacturecode.value;
                    ary[4]=document.getElementById("concentricity_code").value;
                    ary[5]=form1.manufacturename.value;
                    ary[6]=form1.providerid.value;
                    ary[7]=form1.unitprice.value;
                    ary[8]=form1.quantunit.value;
                    ary[9]=form1.manufacturetype.value;
                    ary[10]=form1.manfuacturespec.value;
                    ary[11]=form1.qualityassureperiod.value;
                    ary[12]=form1.manufacturername.value;
                    ary[13]=form1.makearea.value;
                    ary[14]=form1.manufacturebrand.value;
                    ary[15]=form1.drawingpiececode.value;
                    ary[16]=form1.isbuy.value;
                    ary[17]=form1.machinetype.value;
                    ary[18]=form1.property.value;
                    ary[19]=form1.remark.value;
                    ary[20]=form1.balancemode.value;
                    ary[21]=document.getElementById("concentricity_code_back").value;
                    ary[22]=form1.productType.value;
                    ary[23]=form1.productBid.value;
                    ary[24]=form1.kmqualityassureperiod.value;
                    ary[25]=form1.balancecustomercode.value;
                    ary[26]=form1.pic.value;
                    window.returnValue = ary;     
                    window.close();
                }
            }
        }
        function getprovalue(){
            var str="";
            var pr1=document.all.pro1.value;
            var pr2=document.all.machinetype.value;
            var pr3=document.all.pro3.value;
            var pr4=document.all.pro4.value;
            var pr5=document.all.pro5.value;
            var pr6=document.all.pro6.value;
            if(pr1!=""){
                str+=document.getElementById("p1").innerText+"："+pr1+"；";
            }
            if(pr2!=""){
                str+=document.getElementById("p2").innerText+"："+pr2+"；";
            }
            if(pr3!=""){
                str+=document.getElementById("p3").innerText+"："+pr3+"；";
            }
            if(pr4!=""){
                str+=document.getElementById("p4").innerText+"："+pr4+"；";
            }
            if(pr5!=""){
                str+=document.getElementById("p5").innerText+"："+pr5+"；";
            }
            if(pr6!=""){
                str+=document.getElementById("p6").innerText+"："+pr6+"；";
            }
            document.all.property.value=str;
        }
        
        function hiddenProductManger(){
        	var isbuy = document.all.isbuy.value;
        	if(isbuy=="0"){
      		    document.all.productType.selectedIndex="0";
      		    document.all.productBid.selectedIndex="0";
        		document.all.productType.disabled=true;
        		document.all.productBid.disabled=true;
        	}else{
        		document.all.productType.disabled=false;
        		document.all.productBid.disabled=false;
        	}
        }
        
        function doProductType(){
        	 if(!document.all.productBid.options[0].selected&&document.all.productType.value!=1){
        	    alert("招标分类只有1类区域产品才能使用，自动修正产品使用分类选项为1类区域");
                document.all.productType.value = 1;
            }
        }
        
        function doProductBid(){
        	if(!document.all.productBid.options[0].selected&&document.all.productType.value!=1){
        	    alert("只有1类区域产品才有招标分类，自动修正招标分类选项为顶级");
                document.all.productBid.value = "";
            }
        }
        
        function uploadPic()
        {
        	 window.open("<%= response.encodeURL(request.getContextPath() + "/A190022.do?productCode="+manubean.getGs_concentricity())%>","_blank","height="+(window.screen.availHeight-50)+",width="+(window.screen.availWidth-80)+",left=20,top=20,menubar=no,scrollbars=yes");
        }
</script>
</head>
<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">产品信息修改</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>
<br>

<form name="form1" method="post">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr> 
        <td> 
            <table class=bg_table id=tableId    cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
                <tr height="25">
                <TD class="bg_column" align=center>产品种类</TD>
                    <TD class="bg_row_odd" colspan="3">
                        <select name="manuftype1" onChange="change1(this.value)">   
                        <option value="0">-----一级-----</option>             
                        <%
                            String tManufType1 = catbean.getGs_manufacture_category_id1();
                        if("1".equals(catbean.getGs_manufacture_level())){
                            tManufType1=catbean.getGs_manufacture_category_id();
                        }    
                        if(tManuf1 != null && tManuf1.size() > 0 ){
                                for(int i=0; i<tManuf1.size(); i++){
                                    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tManuf1.get(i);
                                    if(tManufType1!=null && tManufType1.equals(tGSManufactureBean.getGs_manufacture_category_id())){
                        %>
                                <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>" selected>
                                <%=tGSManufactureBean.getGs_manufacture_category_name()%></option>
                        <%}else{%>
                                <option value="<%=tGSManufactureBean.getGs_manufacture_category_id()%>">
                                <%=tGSManufactureBean.getGs_manufacture_category_name()%></option>
                        <%          }   
                                }
                            }
                        %>
                        </select>
                        <select id="manuftype2" name="manuftype2" onChange="change2(this.value)">   
                        <option value="0">-----二级-----</option>             
                        <%
                            String tManufType2 = catbean.getGs_manufacture_category_id2();
                        if("2".equals(catbean.getGs_manufacture_level())){
                            tManufType2 = catbean.getGs_manufacture_category_id();
                        }    
                        if(tManufType1 != null && !tManufType1.equals("0")){
                                ArrayList temp = (ArrayList)tMap1.get(tManufType1);
                                if(temp!=null){
                                for(int i=0; i<temp.size(); i++){
                                    GSManufactureCategoryBean tGSManuf2 = (GSManufactureCategoryBean)temp.get(i);
                                    if(tManufType2!=null && tManufType2.equals(tGSManuf2.getGs_manufacture_category_id())){
                        %>
                                <option value="<%=tManufType2%>" selected><%=tGSManuf2.getGs_manufacture_category_name()%></option>
                        <%}else{%>
                                <option value="<%=tGSManuf2.getGs_manufacture_category_id()%>"><%=tGSManuf2.getGs_manufacture_category_name()%></option>
                                
                        <%          }   
                                }
                               }
                            }
                        %>

                        </select>
                        <select name="manuftype3" id="manuftype3">  
                        <option value="0">-----三级-----</option>             
                        <%
                            String tManufType3 = catbean.getGs_manufacture_category_id();
                            if(tManufType2 != null && !tManufType2.equals("0") ){
                                ArrayList temp = (ArrayList)tMap2.get(tManufType2);
                                if(temp!=null){
                                for(int i=0; i<temp.size(); i++){
                                    GSManufactureCategoryBean tGSManuf3 = (GSManufactureCategoryBean)temp.get(i);
                                    if(tManufType3!=null && tManufType3.equals(tGSManuf3.getGs_manufacture_category_id())){
                        %>
                                <option value="<%=tGSManuf3.getGs_manufacture_category_id()%>" selected><%=tGSManuf3.getGs_manufacture_category_name()%></option>
                        <%}else{%>
                                <option value="<%=tGSManuf3.getGs_manufacture_category_id()%>"><%=tGSManuf3.getGs_manufacture_category_name()%></option>
                                
                        <%          }   
                                }
                              }
                            }
                        %>

                        </select>&nbsp; <font color=red>*</font>
                    </TD>
                </tr>
                <TR height=25>
                    <TD class="bg_column" align=center>产品编号</TD>
                    <TD align=left class="bg_row_odd"><%=manubean.getGs_manufacture_id()%>
                    <input type="hidden" name="manufacturecode" value="<%=StringUtils.escapeXML(manubean.getGs_manufacture_id())%>"></TD>                    
                    <TD class="bg_column" align=center>集中编码</TD>
                    <TD align=left class="bg_row_odd">
                    <input type="text" id="concentricity_code" name="concentricity_code" value="<%=manubean.getGs_concentricity() %>" onblur="selectyes(this,'1');"/><font color=red id="conidyes">*</font>
                    <input type="hidden" id="concentricity_code_back" name="concentricity_code_back" style="ime-mode:disabled"  value="<%=manubean.getGs_concentricity() %>">
                    <input type="hidden" id="sign" value="0">
                    </TD>
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>产品名称</TD>
                    <TD align=left class="bg_row_odd">
                    <input type="text" name="manufacturename" value="<%=StringUtils.escapeXML(manubean.getGs_manufacture_name()) %>">&nbsp; <font color=red>*</font></TD>
                    <TD class="bg_column" align=center>供应商</TD>
                    <TD align=left class="bg_row_odd">
                    <%=providerName%>
                    <input type="hidden" id='provider_id' name="providerid" value="<%=manubean.getGs_provider_id()%>"></TD>
                </TR>
                <TR height=25>
                <TD class="bg_column" align=center>产品单价</TD>
                    <TD align=left class="bg_row_odd">
                    <input type="text" name="unitprice" readonly="readonly" onfocus="getoldprice(this);"  value="<%=manubean.getGs_manufacture_unitprice()%>" disabled="disabled">&nbsp;元&nbsp; <font color=red>*</font></TD>                 
                    <TD class="bg_column" align=center>数量单位</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="quantunit" value="<%=StringUtils.escapeXML(manubean.getGs_quant_unit()) %>">&nbsp; <font color=red>*</font></TD>               
                </TR>
                
                <%
                            if(isPlanPrice.equals("1")){
                        %>
                <tr>
                <TD class="bg_column" align=center>计划价</TD>
                        <%
                            if(count.equals("0.0")){
                        %>
                    <TD align=left class="bg_row_odd"><input type="text" name="planprice" onblur="pricef(this);" value="<%=manubean.getPlan_price()%>">&nbsp;元&nbsp; <font color=red>*</font></TD>                 
                    <%}else{%>
                    <TD align=left class="bg_row_odd"><input readonly type="text" name="planprice" onblur="pricef(this);" value="<%=manubean.getPlan_price()%>">&nbsp;元&nbsp; <font color=red>库存不为0，不能修改计划价</font></TD>                 
                    <%}%>
                    <TD class="bg_column" align=center></TD>
                    <TD align=left class="bg_row_odd"></TD>               
                </TR>
                        <%}%>
                <TR height=25>
                    <TD class="bg_column" align=center>型号</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="manufacturetype" value="<%=StringUtils.escapeXML(manubean.getGs_manufacture_type()) %>"></TD>                    
                    <TD class="bg_column" align=center>规格</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="manfuacturespec" value="<%=StringUtils.escapeXML(manubean.getGs_manufacture_spec()) %>"></TD>
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>质保期</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="qualityassureperiod" value="<%=StringUtils.escapeXML(manubean.getGs_quality_assure_period())%>"></TD>                    
                    <TD class="bg_column" align=center>生产厂商</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="manufacturername" value="<%=StringUtils.escapeXML(manubean.getGs_manufacturer_name())%>"></TD>                  
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>产地</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="makearea" value="<%=StringUtils.escapeXML(manubean.getGs_make_area()) %>"></TD>                  
                    <TD class="bg_column" align=center>产品品牌</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="manufacturebrand" value="<%=StringUtils.escapeXML(manubean.getGs_manufacture_brand())%>"></TD>                      
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>图件号</TD>
                    <TD align=left class="bg_row_odd"><input type="text" name="drawingpiececode" value="<%=StringUtils.escapeXML(manubean.getGs_drawing_peice_code())%>"></TD>
                    <TD class="bg_column" align=center>是否采购</TD>
                    <TD align=left class="bg_row_odd">
                    <select name="isbuy" onchange="hiddenProductManger()">
                    <%
                    if(manubean.getIs_buy().equals("1")){
                    %>
                    <option value="1" selected>-是-</option>
                    <%
                    }else{
                    %>
                    <option value="0" selected>-否-</option>
                    <%}%>
                    </select>&nbsp; <font color="red">设置为否的产品在申购时无法查询到</font>
                    </TD>
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>结算模式</TD>
                    <TD align=left class="bg_row_odd">
                    <select name="balancemode">
                    <%
                    String sel1="";
                    String sel2="selected";
                    if(manubean.getGs_balance_mode().equals(GSBaseConstants.BALANCE_MODE1)){
                        sel1="selected";
                        sel2="";
                    }
                    %>
                    <%
                            if(isPlanPrice.equals("1")){
                        %>
                        <option value="<%=GSBaseConstants.BALANCE_MODE2 %>" <%=sel2 %>><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE2) %></option>
                        <%}else{ %>
                        <option value="<%=GSBaseConstants.BALANCE_MODE1 %>" <%=sel1 %>><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE1) %></option>
                        <option value="<%=GSBaseConstants.BALANCE_MODE2 %>" <%=sel2 %>><%=DefineDic.getBalanceMode(GSBaseConstants.BALANCE_MODE2) %></option>
                        <%} %>
                    </TD>
                    <TD class="bg_column" align=center>公里质保期</TD>
                    <TD align=left class="bg_row_odd">
                   			  <input type="text" name="kmqualityassureperiod" value="<%=manubean.getKm_quality_assure_period() %>"><font color="red">单位为公里</font>
                    </TD>
                </TR>
                 <TR height=25>
                    <TD class="bg_column" align=center>产品使用分类</TD>
                    <TD align=left class="bg_row_odd">
                    	 <select name = "productType" >
                    	 			<option value="">顶级</option>
								<%
									GSProductTypeDao dao = new GSProductTypeDao();
									GSProductTypeBean bean = dao.findProductTypeByProuductCode(manubean.getGs_concentricity());
									int type = 0;
									if(bean!=null){
										type = bean.getProductType();
									}
									Conditions condition = new Conditions();
									condition.add(" upper_type = '"+GSBaseConstants.PRODUCT_TYPE_MANAGER_USE+"' ");
									condition.add(" status = 1");
									ObjectList list = ProductTypeManager.fetch().search(DBConnection.open(),condition);
									for(int i=0;i<list.size();i++){
									ProductTypeManager productType = (ProductTypeManager)list.get(i);
								 %>
										<option value="<%=productType.getProductType() %>" <%if(productType.getProductType().equals(String.valueOf(type))) {%> selected="selected"<%} %>><%=productType.getTypeName() %></option>
								<%
									}
								 %>
							</select>
                    
                    </TD>
                    <TD class="bg_column" align=center>产品分类</TD>
                    <TD align=left class="bg_row_odd">
                   			 <select name = "productBid" >
                    	 			<option value="">顶级</option>
								<%
									GSProductBidDao bidDao = new GSProductBidDao();
									GSProductBidBean bidBean = bidDao.findProductBidByProuductCodeStatus(manubean.getGs_concentricity());
									int bidType = 0;
									if(bidBean!=null){
										bidType = bidBean.getProductType();
									}
									Conditions conditionBid = new Conditions();
									conditionBid.add(" upper_type = '"+GSBaseConstants.PRODUCT_TYPE_MANAGER_BID+"' ");
									conditionBid.add(" status=1");
									ObjectList bIdlist = ProductTypeManager.fetch().search(DBConnection.open(),conditionBid);
									for(int i=0;i<bIdlist.size();i++){
									ProductTypeManager productType = (ProductTypeManager)bIdlist.get(i);
								 %>
										<option value="<%=productType.getProductType() %>" <%if(productType.getProductType().equals(bidType==0?"":String.valueOf(bidType))) {%> selected="selected"<%} %>><%=productType.getTypeName() %></option>
								<%
									}
								 %>
							</select>
                    
                    </TD>
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>是否到单车</TD>
                    <TD align=left class="bg_row_odd" >
                    <select name="balancecustomercode">
                    <%
                    if(manubean.getBalance_customer_code().equals("1")){
                    %>
                    <option value="1" selected>-否-</option>
                    <option value="0">-是-</option>
                    <%
                    }else{
                    %>
                    <option value="1">-否-</option>
                    <option value="0" selected>-是-</option>
                    <%}%>
                    </select>
                    </TD>
                    <TD class="bg_column" align=center>是否允许出库</TD>
                    <TD align=left class="bg_row_odd" >
                    <select name="pic">
                    <%
                    if(manubean.getGs_manufacture_images().equals("1")){
                    %>
                    <option value="1" selected>-是-</option>
                    <option value="0">-否-</option>
                    <%
                    }else{
                    %>
                    <option value="1">-是-</option>
                    <option value="0" selected>-否-</option>
                    <%}%>
                    </select>
                    <font color="red">压库产品在不可采购的情况下出库</font>
                    </TD>
                </TR>
                
                <TR height=25>
                    
                    <TD class="bg_column" align=center>产品附加属性</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                    <table border="0" cellpadding="0" cellspacing="0" width="500" height="70">
                    <tr height="20">
                    <td id="p1" width="60">适用车型</td>
                    <td>
                    <input type="text" size="30" name="pro1" value="<%=map.get("pro1")==null?"":StringUtils.escapeXML((String)map.get("pro1"))%>"></td>
                    <td id="p2" width="60" align="center">适用机型</td>
                    <td><input type="text" size="30" name="machinetype" value="<%=map.get("pro2")==null?"":StringUtils.escapeXML((String)map.get("pro2"))%>">
                    </td>
                    </tr>
                    <tr  height="20">
                    <td id="p3" width="60">适用底盘</td>
                    <td><input type="text" size="30" name="pro3" value="<%=map.get("pro3")==null?"":StringUtils.escapeXML((String)map.get("pro3"))%>"></td>
                    <td id="p4" width="60" align="center">级别特征</td>
                    <td><input type="text" size="30" name="pro4" value="<%=map.get("pro4")==null?"":StringUtils.escapeXML((String)map.get("pro4"))%>"></td>
                    </tr>
                    <tr height="20">
                    <td id="p5" width="60">材质</td>
                    <td><input type="text" size="30" name="pro5" value="<%=map.get("pro5")==null?"":StringUtils.escapeXML((String)map.get("pro5"))%>"></td>
                    <td id="p6" width="60" align="center">其他属性</td>
                    <td><input type="text" size="30" name="pro6" value="<%=map.get("pro6")==null?"":StringUtils.escapeXML((String)map.get("pro6"))%>"></td>
                    </tr>
                    </table>
                    <input type="hidden" name="property"></TD>                                     
                </TR>
                <TR height=25>
                    <TD class="bg_column" align=center>备注</TD>
                    <TD align=left class="bg_row_odd" colspan="3">
                    <textarea rows="8" cols="80" name="remark" ><%=StringUtils.escapeXML(manubean.getGs_remark())%></textarea>
                    </TD>                 
                </TR>
            </table>
        </td>
    </tr>
</table>
<br>&nbsp;&nbsp;&nbsp; <font color="red">备注长度不能超过2000字符</font>
</form>
    <p align="center">  
        <input type="button" width="58" height="24" class="kuang" onclick="uploadPic();" value="产品图片"/>&nbsp;
        <input type="button" width="58" height="24" class="kuang" onclick="process();" value="确定"/>&nbsp;
        <input type="button"  width="58" height="24" class="kuang" onclick="window.close();" value="关闭"/>
    </p>
</body>
</html>